/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package descentserver;

import com.esotericsoftware.kryo.Kryo;
import com.esotericsoftware.kryonet.Server;
import java.io.IOException;
import com.esotericsoftware.minlog.Log;
import descentserver.Packet.*;

/**
 *
 * @author jimmy
 */
public class DescentServer  {
    private Server server;
    
    public DescentServer() throws IOException {
        server = new Server();
        registerPackets();
        server.addListener(new NetworkListener());
        server.bind(7386);
        server.start();
        
    }
    
    private void registerPackets(){
        Kryo kryo = server.getKryo();
        kryo.register(PacketLoginRequest.class);
        kryo.register(PacketLoginAccepted.class);
        kryo.register(PacketMessage.class);
    
    }
    
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        try {
            DescentServer descentServer = new DescentServer();
            Log.set(Log.LEVEL_DEBUG);
        } catch (IOException e) {
        }
     
        // TODO code application logic here
    }
}
